/**
 * Copyright 2008-2009. Chongqing Communications Industry Services Co.,Ltd Information Technology Branch. All rights
 * reserved. <a>http://www.cqcis.com</a>
 */
package com.cqcis.uip.base.ds;

import java.sql.ResultSet;
import java.sql.SQLException;
import java.util.ArrayList;
import java.util.List;

import org.springframework.jdbc.core.RowCallbackHandler;
import org.springframework.jdbc.core.support.JdbcDaoSupport;

/**
 * @author huangmy
 * @date   2008-3-3
 */
public class SysTablesDao extends JdbcDaoSupport {
    private static String selectSql = "select first 5 tabname from systables;";
    
    public List<String> query() {
    	final List<String> list = new ArrayList<String>();
    	
    	super.getJdbcTemplate().query(selectSql, new RowCallbackHandler() {
    		public void processRow(ResultSet rs) throws SQLException {
    			list.add(rs.getString(1));
    		}
    	});
    	
    	return list;
    }
}
